package com.kaoshi.utils;

import com.github.pagehelper.PageInfo;
import lombok.Data;
import org.springframework.context.annotation.Configuration;

import java.util.List;

@Data
@Configuration
public class PageInfoRes<T> {
    private Long total;
    private int pageNum;
    private int pageSize;
    private List<T> list;

    public PageInfoRes getPageInfoRes(PageInfo<T> T, PageInfoRes<T> pageInfoRes, int pageNum, int pageSize){
        pageInfoRes.setPageNum(pageNum);
        pageInfoRes.setPageSize(pageSize);
        pageInfoRes.setTotal(T.getTotal());
        pageInfoRes.setList(T.getList());
        return pageInfoRes;
    }
}
